﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Brain
{
    public static class QuaternionUtil
    {
        /// <summary>
        /// Returns a Quaternion with the Rotation Converted to Radians
        /// </summary>
        /// <param name="RotationInDegrees">Rotation in Degrees</param>
        /// <returns></returns>
        public static Quaternion DegreesVectorToQuaternion(Vector3 RotationInDegrees)
        {
            return Quaternion.CreateFromYawPitchRoll(MathHelper.ToRadians(RotationInDegrees.Y),
                MathHelper.ToRadians(RotationInDegrees.X),
                MathHelper.ToRadians(RotationInDegrees.Z));
        }

        /// <summary>
        /// Returns a Quaternion with the Rotation Converted to Radians
        /// </summary>
        /// <param name="RotationInDegrees">Rotation in Degrees</param>
        /// <returns></returns>
        public static Quaternion CreateQuaternion(Vector3 RotationInRadians)
        {
            return Quaternion.CreateFromYawPitchRoll(RotationInRadians.Y,
                RotationInRadians.X,
                RotationInRadians.Z);
        }
    }
}
